/*
 * @Descripttion: 
 * @version: 
 * @Author: 
 * @Date: 2022-05-09 13:26:25
 * @LastEditors: weidelong
 * @LastEditTime: 2022-05-09 13:42:38
 */
const mongoose = require("./db")
const conn = mongoose.connection
conn.on("error", () => console.log("连接数据库失败"))

// 模型对象
const articleSchema  = mongoose.Schema({
  id: { type: String },
  title: { type: String }, //标题
  author: { type: String }, //作者
  cover: { type: String }, //封面
  content: { type: String }, //内容
  addTime: { type: String } ,//创建时间
  audit: { type: String }, // 审核状态
  note: { type: String }, // 备注
  auditTime: { type: String } ,//审核时间
  using: { type: Boolean }, // 是否启用
});

const article = mongoose.model("articles", articleSchema )
module.exports = article